package e.odbo.data.service.base.impl;

import com.openbravo.data.basic.BasicException;
import e.odbo.data.bean.I_ViewBean;
import e.odbo.data.dao.ViewDAO;
import e.odbo.data.dsl.Select;
import e.odbo.data.dsl.operation.QueryOperation;
import e.odbo.data.dsl.query.QBFParameter;
import e.odbo.data.dsl.query.QBFParameters;
import e.odbo.data.service.base.I_ViewBeanService;

import java.util.List;

public class ViewBeanServiceWarp<T extends I_ViewBean> implements I_ViewBeanService<T> {

    ViewDAO<T> viewDAO;

    public ViewBeanServiceWarp(ViewDAO<T> viewDAO) {
        this.viewDAO = viewDAO;
    }

    @Override
    public List<T> list() throws BasicException {
        return viewDAO.list();
    }

    @Override
    public List<T> list(QueryOperation queryOperation) throws BasicException {
        return viewDAO.list(queryOperation);
    }

    @Override
    public List<T> query(QBFParameter filter) throws BasicException {
        return viewDAO.query(filter);
    }

    @Override
    public List<T> query(QBFParameter filter, QueryOperation queryOperation) throws BasicException {
        return viewDAO.query(filter,queryOperation);
    }

    @Override
    public List<T> query(QBFParameters qbfParameters) throws BasicException {
        return viewDAO.query(qbfParameters);
    }

    @Override
    public List<T> query(QBFParameters qbfParameters, QueryOperation queryOperation) throws BasicException {
        return viewDAO.query(qbfParameters,queryOperation);
    }

    @Override
    public List<T> listBySelect(Select select) throws BasicException {
        return viewDAO.listBySelect(select);
    }

    @Override
    public int count() throws BasicException {
        return viewDAO.count();
    }

    @Override
    public int count(QBFParameters filter) throws BasicException {
        return viewDAO.count(filter);
    }
}
